package com.usian;

import com.netflix.loadbalancer.RandomRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@EnableEurekaClient
@SpringBootApplication
@EnableFeignClients//开启feign接口扫描
public class ConsumerApp {
    //默认使用轮回策略
    public static void main(String[] args) {
        SpringApplication.run(ConsumerApp.class, args);
    }

    //随机策略
    @Bean
    public RandomRule getRuleribbonRule() {
        return new RandomRule();
    }
}
